package com.software.sqlite.mapper;

import com.software.sqlite.common.BaseMapper;
import com.software.sqlite.entity.TbMovie;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface TbMovieMapper extends BaseMapper<TbMovie> {


    TbMovie selectMovieByMovieId(@Param("movieId")String movieId,@Param("movieUrl")String movieUrl);

    List<TbMovie> selectMovieList(@Param("userToken")String userToken,@Param("movieUrl")String movieUrl);

    List<TbMovie> selectDangjianList(@Param("userToken")String userToken,@Param("movieUrl")String movieUrl);

    List<TbMovie> selectZonyiList(@Param("userToken")String userToken,@Param("movieUrl")String movieUrl);

    TbMovie myMovie(@Param("userToken")String userToken,@Param("movieId")String movieId,@Param("movieUrl")String movieUrl);

    void updateAmount(@Param("amount")BigDecimal amount,@Param("movieId")Long movieId);

    void updateModel(@Param("model")TbMovie model);

    void deleteAllDangjian(@Param("movieIdArray")Long[] movieIdArray);

    void deleteAllZongyi(@Param("movieIdArray")Long[] movieIdArray);

    List<TbMovie> findMovieListByIds(@Param("movieIdArray")Long[] movieIdArray);

    Integer getMinMovieId();


    /**
     * 删除movie
     * @param movieId
     */
    void deleteByMovieId(@Param("movieId")Long movieId);

}
